/*
 * mlog.h
 *
 *  Created on: Apr 4, 2021
 *      Author: c
 */

#ifndef MLOG_H_
#define MLOG_H_
#include <stdio.h>
#include <stdint.h>




/*调试等级*/
typedef enum{
    LOG_DEBUG=1,
    LOG_INFO=2,
    LOG_WARN=4,
    LOG_ERROR=8,
    LOG_FATAL=16,
    LOG_ANY=32,
    LOG_IMP = 64,
    LOG_ALL=0XFF,
}LogLevel;

#define DEBUG_LEVEL 0xff //(LOG_ERROR)

#define mprintf(level,format,...)  ((level & DEBUG_LEVEL) ? printf(format,##__VA_ARGS__) : 0)

void mprintfhex(char* str, uint8_t* data, uint16_t len);
#endif /* MLOG_H_ */
